package mk.jug.academy.service;


import mk.jug.academy.model.Page;
import mk.jug.academy.model.Supporter;
import mk.jug.academy.model.SupporterStatus;

/**
 * Defines the contract for the services regarding a {@link Supporter} in the system.
 *
 * @author Ice.Penov
 */
public interface SupporterService {
	
	/**
	 * Adds a {@link Supporter} to the Java Academy Initiative.
	 */
	void signUpSupporter(Supporter supporter);

	/**
	 * Gets the {@link Supporter}s of the Java Academy Initiative,
	 * with the {@link SupporterStatus#SIGNED_UP} status, 
	 * ordered by their rating.
	 */
	Page<Supporter> listSignedUp(int pageNumber, int itemsPerPage);
	
	/**
	 * Gets the {@link Supporter}s of the Java Academy Initiative,
	 * with the {@link SupporterStatus#ACTIVE} status, 
	 * ordered by their rating.
	 */
	Page<Supporter> listActive(int pageNumber, int itemsPerPage);
	
	/**
	 * Gets the {@link Supporter}s of the Java Academy Initiative,
	 * with the {@link SupporterStatus#DELETED} status, 
	 * ordered by their rating.
	 */
	Page<Supporter> listDeleted(int pageNumber, int itemsPerPage);
	
	
	/**
	 * Deletes the {@link Supporter}.
	 */
	void deleteSupporter(Supporter supporter);
	
	/**
	 * Activates a {@link Supporter}.
	 */
	void activateSupporter(Supporter supporter);
	
	/**
	 * Checks whether there is a {@link Supporter} with the specified email.
	 */
	boolean exists(String email);
	
	/**
	 * Get the {@link Supporter} by the email.
	 */
	Supporter findByEmail(String email);
	
	/**
	 * Gets the {@link Supporter} by its ID.
	 */
	Supporter load(Long id);
	

}